package com.zzx.config;


import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import com.zzx.model.User;

@Component
public class String2Userconver implements Converter<String,User> {

	//张三：：asdfasdf：：8
	@Override
	public User convert(String source) {
		String [] args=source.split("::");
		User user=new User();
		user.setName(args[0]);
		user.setPassword(Integer.valueOf(args[2]));
		user.setId(8);
		
		return user;
	}

}
